<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core" 
  xmlns:p="http://primefaces.org/ui" 
  xmlns:h="http://java.sun.com/jsf/html" 
  xmlns:pr="http://java.sun.com/jsf/composite/totororo"
  template="../template_front.xhtml">
  
  <ui:define name="content">  
		<div class="produit-details">  	
		  	<div class="image">	    
				<pr:photo type="book" elementId="#{book.id}" size="small"/>
			</div>
			<div class="details">
				<div class="title">			
	  				<h:outputText value="#{book.title}"/>
				</div>
				<div class="date">
					 <h:outputFormat value="Date de parution : #{homeController.book.date}" >
					    <f:convertDateTime pattern="dd/MM/yyyy" />
					 </h:outputFormat>
				 </div>
				 <div class="category">
					 <h:outputText value="Catégorie : #{homeController.book.category.title}" />
				 </div>
				<div class="price">		
		     		<h:outputText value="#{homeController.book.price} €"/>
		     	</div>
		     	<h:form>  	
			     	<div class="add-cart">
			     		<h:commandLink action="#{cartController.addToCart}">
			     			<img src="#{facesContext.externalContext.requestContextPath}/resources/images/add-cart.png" />
			     			<f:param name="bookId" value="#{homeController.book.id}" />
			     		</h:commandLink>
			     	</div>
		     	</h:form>   
			</div>
			<div class="clearer"></div>		     	
	     </div>
  </ui:define>
</ui:composition>
